<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OpenMesh: Conceptual Class Hierarchy</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="logo_align.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="rwth_vci_rgb.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OpenMesh
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('a04323.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Conceptual Class Hierarchy </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Since there is no such thing as a OpenMesh class and the library makes heavy use of C++ template, we show the inheritance graph of <a class="el" href="a02377.html" title="Triangle mesh based on the ArrayKernel. ">OpenMesh::TriMesh_ArrayKernelT</a> as proxy for all possible mesh types.</p>
<p>Please note! Most of the inheritence relationships are realized by template parameterization! Therefore some of the inheritance links are not documented in a inheritance graph in the reference. This picture shows the overall concept.</p>
<div class="image">
<img src="class-hierarchy2.png" alt="class-hierarchy2.png"/>
</div>
<h1><a class="anchor" id="ch_kernel"></a>
Building the kernel</h1>
<ol type="1">
<li>The BaseKernel defines the basic operations on properties like add/remove/access.</li>
<li>Next the AttribKernelT adds the standard properties all associated methods.</li>
<li>Finally the ArrayKernelT provides the methods to add/remove/access the mesh items vertices, (half-)edges, and faces. The base class is passed as a template parameter, since depending on the underlying storage type the AttribKernel might change.</li>
</ol>
<h1><a class="anchor" id="ch_complete"></a>
Building the mesh</h1>
<ol type="1">
<li>The PolyMeshT inherits from the kernel and provide all necessary methods to work with polygonal meshes.</li>
<li>Finally we derive TriMeshT from PolyMeshT to have an specialization for triangle meshes.</li>
</ol>
<p>Looks simple, but it isn't - it's a bit more complicated:</p>
<div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">class</span> Traits&gt;</div><div class="line"><span class="keyword">struct </span>TriMesh_ArrayKernel_GeneratorT</div><div class="line">{</div><div class="line">  <span class="keyword">typedef</span> FinalMeshItemsT&lt;ArrayItems, Traits, true&gt;  MeshItems;</div><div class="line">  <span class="keyword">typedef</span> AttribKernelT&lt;MeshItems&gt;                   AttribKernel;</div><div class="line">  <span class="keyword">typedef</span> ArrayKernelT&lt;AttribKernel, MeshItems&gt;      MeshKernel;</div><div class="line">  <span class="keyword">typedef</span> TriMeshT&lt;MeshKernel&gt;                       Mesh;</div><div class="line">};</div></div><!-- fragment --><p>To generate the actual mesh type the helper template class <code>TriMesh_ArrayKernel_GeneratorT</code> is used. It takes the traits in a template argument and passes it to <code>FinalMeshItemsT</code> to get the final type of the mesh items (MeshItems). The <code>MeshItems</code> defines the types for Point, Normal, Color, TexCoord, Vertex, and for all mesh items. With the help of <code>MeshItems</code> create the type of the <code>AttribKernel</code>, which defines the apropriate standard properties for the items. Finally use <code>AttribKernel</code> and <code>MeshItems</code> to create the mesh kernel type <code>MeshKernel</code>. It's quite a way to get a kernel . As long as the created kernel follows the kernel concept (<a class="el" href="a01229.html">Mesh Kernels</a>), we can easily create now the mesh. Here we use now <code>TriMeshT</code> to create the final mesh type <code>Mesh</code>. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<hr>
<address>
<small>
<a href="http://www.rwth-graphics.de" style="text-decoration:none;">
</a>
Project <b>OpenMesh</b>, 
&copy;&nbsp; Computer Graphics Group, RWTH Aachen.
Documentation generated using 
<a class="el" href="http://www.doxygen.org/index.html">
<b>doxygen</b>
</a>.
</small>
</address>
</body>
</html>
